package com.xqyq.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xqyq.dao.ReportDao;
import com.xqyq.model.Report;

@Service
public class ReportService {
	@Autowired
	private ReportDao reportDao;
	
	public boolean addReport(Report report){
		return reportDao.addReport(report);
	}
	
	public List<Report> getAllReport(){
		return reportDao.getAllReport();
	}
	
	public Report getTheWholeReport(int report_id){
		Report report = reportDao.getReport(report_id);
		System.out.println(report.getReport_content().getContent_id());
		return report;
	}
	
	public void updateReport(Report report){
		reportDao.updateReport(report);
	}
	
	public void deleteReport(int report_id){
		reportDao.deleteReport(report_id);
	}
	
	public List<Report> getReports(int limit){
		return reportDao.getReports(limit);
	}
	
}
